from sqlalchemy import Table, MetaData, Column, Integer, String, ForeignKey,Date
from sqlalchemy.orm import registry
mapper_registry = registry()
Base = mapper_registry.generate_base()

# 学院信息表
class Colleges(Base):
    __tablename__ = "colleges"

    cl_id = Column(String(32), primary_key=True)

    cl_name = Column(String(32))


    # 创建时间
    # 补全创建时间的类型只要年月日
    creat_time = Column(Date)


#     初始化
    def __init__(self,cl_id=None,cp_name=None,cl_name=None,creat_time=None):
        self.cl_id = cl_id
        self.cl_name = cl_name
        self.creat_time = creat_time

    def format_str(self):
        return "学院信息表:学院id:%s,学院名称:%s,创建时间:%s" % (self.cl_id,self.cl_name,self.creat_time)








